import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("industry", { schema: "alumni" })
export class Industry {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("varchar", { name: "name", comment: "名称", length: 20 })
  name: string;

  @Column("int", { name: "code", unsigned: true })
  code: number;

  @Column("int", { name: "parent_id", default: () => "'0'" })
  parentId: number;

  @Column("int", {
    name: "top_id",
    comment: "最顶级id",
    unsigned: true,
    default: () => "'0'",
  })
  topId: number;

  @Column("int", { name: "level", unsigned: true, default: () => "'0'" })
  level: number;
}
